Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisation: Prevent creating multiple ws connections on client #654

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

ToufeeqP
Copy link
Contributor

Pull Request type

  • Optimisation:

Description

Preventing rust interfaces from creating multiple ws connections for a single client.

BREAKING CHANGE:

This is a breaking change in avail-subxt as it removes rpc_methods from the AvailClient.

Checklist

  • I have performed a self-review of my own code.
  • The tests pass successfully with cargo test.
  • The code was formatted with cargo fmt.
  • The code compiles with no new warnings with cargo build --release and cargo build --release --features runtime-benchmarks.
  • The code has no new warnings when using cargo clippy.
  • If this change affects documented features or needs new documentation, I have created a PR with a documentation update.

@ToufeeqP ToufeeqP changed the title Toufeeq/fix rust interfaces Optimisation: Prevent creating multiple ws connections on client Sep 10, 2024
let mut params = RpcParams::new();
params.push(cells)?;
params.push(block_hash)?;
let actual_proof: Vec<GDataProof> = client.rpc().request("kate_queryProof", params).await?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As side-effect, this also remove the capability of use the RPC with type safety.
I think it is not a good a Rusty-approach, because any future change in RPC on future release will be hardly detected on Rust clients.

@ToufeeqP ToufeeqP merged commit 38faf63 into main Oct 3, 2024
16 checks passed
@ToufeeqP ToufeeqP deleted the toufeeq/fix-rust-interfaces branch October 3, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants